<?php

//echo("<pre>");
//print_r($_POST);
//echo("</pre>");


if (!empty($_POST['del']) and $_POST['del']=="yes") {
	$SQL="DELETE FROM `".prefix.$rname."_data` WHERE `ID`=".$obj;
	//echo "<br><br>".$SQL1."<br>"; 
	$del=mysql_query($SQL);
	
	if (!empty($del)) { 
		$output="Операция по удалению объекта прошла успешно, поздравляем!";
		?><meta http-equiv="refresh" content="3;url=/<?=FS_CMS?>/list/<?=$rname?>/">
		
		<div style="">
		<table>
		<tr>
			<td style="padding:0px 5px 0px 0px;"><a href="/<?=FS_CMS?>/list/<?=$rname?>/" style="cursor:pointer;"><img src="<?=$design_path?>images/back.png" width="16" height="16" alt="Вернуться назад" border="0"></a></td>
			<td style="padding:0px 20px 0px 0px;"><a href="/<?=FS_CMS?>/list/<?=$rname?>/" style="cursor:pointer;">Вернуться назад</a></td>
		</tr>
		</table>
		</div>
		<br/>
		<?
	}//if (!empty($del)) {
	else $output="Ошибка при удалении объекта";
	
}//if ($_POST=="yes") {
if (!empty($_POST['del']) and $_POST['del']=="no") {
		$output="Хорошо. Возвращаемся к списку объектов!";
		$del=1;
		?><meta http-equiv="refresh" content="2;url=/<?=FS_CMS?>/list/<?=$rname?>/">
		
		<div style="">
		<table>
		<tr>
			<td style="padding:0px 5px 0px 0px;"><a href="/<?=FS_CMS?>/list/<?=$rname?>/" style="cursor:pointer;"><img src="<?=$design_path?>images/back.png" width="16" height="16" alt="Вернуться назад" border="0"></a></td>
			<td style="padding:0px 20px 0px 0px;"><a href="/<?=FS_CMS?>/list/<?=$rname?>/" style="cursor:pointer;">Вернуться назад</a></td>
		</tr>
		</table>
		</div>
		<br/>
		<?

}//if ($_POST['del']=="no") {


?>
<!-- верхняя часть -->
<div style="border-bottom:1px solid #ccc;">
	<h1>Удаляем <?=$razdel[$rname]['add-string'];?> из раздела &laquo;<?=$razdel[$rname]['name'];?>&raquo;</h1>

</div>

<?php
if (!empty($output)) {?>
<div class="output">
	<?php echo $output;?>
</div>
<?php
}//}
?>


<?php
if (empty($del)) { 
?>



<h2>Вы уверены что хотите удалить эту <?=$razdel[$rname]['add-string'];?> из раздела &laquo;<?=$razdel[$rname]['name'];?>&raquo;?</h2>

<br/>
<?php

$form=new form_class;

/*
 * Define the name of the form to be used for example in Javascript
 * validation code generated by the class.
 */
	$form->NAME="del_form";
/*
 * Define the name of the form to be used for example in Javascript
 * validation code generated by the class.
 */
	$form->SCLASS="otziv-form";

/*
 * Use the GET method if you want to see the submitted values in the form
 * processing URL, or POST otherwise.
 */
	$form->METHOD="POST";

/*
 * Make the form be displayed and also processed by this script.
 */
	$form->ACTION="";
/*
 * Output all validation errors at once.
 */
	$form->ShowAllErrors=1;


/*
   $form->AddInput(array(
     "NAME"=>"del",
     "TYPE"=>"checkbox",
     "VALUE"=>$obj
   )); 	
   

   $form->AddInput(array(
     "NAME"=>"del",
     "TYPE"=>"checkbox",
     "VALUE"=>$obj
   )); 
   
  */ 
   
  	$form->AddInput(array(
		"TYPE"=>"radio",
		"NAME"=>"del",
		"VALUE"=>"yes",
		"ID"=>"del_yes",
		
		"LABEL"=>"Да"
		
	));
	$form->AddInput(array(
		"TYPE"=>"radio",
		"NAME"=>"del",
		"VALUE"=>"no",
		"ID"=>"del_no",
		"LABEL"=>"Нет"
	));

   
   
 $form->AddInput(array(
     "ID"=>"submit",
     "VALUE"=>"Совершить действие",
     "TYPE"=>"submit",
     "CLASS"=>"submit"
   ));
   
   $form->StartLayoutCapture();
   ?>
   
	<div class="field" id="yes" style="float:left; width:70px; background-color:green;  padding:10px 0px 0px 20px; border:0px solid red;">
		 <div class="fname text">
		   <?php
		   $form->AddLabelPart(array("FOR"=>"del_yes"));
		 ?>
		</div> 
	 	<div class="fform"><?php $form->AddInputPart("del_yes"); ?></div>
	 	
	 </div>
	 
	<div class="field" id="no" style="float:left; width:70px; margin-left:20px; padding:10px 0px 0px 20px; background-color:red; border:0px solid red;">
		 <div class="fname text">
		   <?php
		   $form->AddLabelPart(array("FOR"=>"del_no"));
		 ?></div> 
	 	<div class="fform"><?php $form->AddInputPart("del_no"); ?>
		</div>
	 	
	 </div>

	<div class="clearfix"></div>
	<br/><br/>	
	  <div class="field"><?php $form->AddInputPart("submit"); ?></div>
	  
  
  
   <?
   $form->EndLayoutCapture();

   $form->DisplayOutput();

}//if (!empty($del)) { 
?>


<!-- // верхняя часть -->
<br/>
